var person = {
    "my name":"anni",//属性用字符串且有空格
    age:18,
    "favo":"apple",
    sex:"男",
    18:true,//属性为数字
    3:"女朋友",
    smoke:smoke
}

console.log(person);
console.log(person["my name"]);//有空格,或者数字属性,用类似数组的方式取出来
console.log(person[18]);
console.log(person.favo);
person.smoke();
//给对象添加方法
function smoke(){
    console.log("i like smoke");
}

console.log('============================');

var o = new Object();
o.name = "张三";
o.age = 18;
o.smoke = smoke;

o.smoke();
console.log(o.name);
var s = "age";
console.log(o["age"]);
console.log(o[s]);
o.say=function(){
    console.log("i like say");
}
o.say();


